﻿using System;
using System.Collections.Generic;
using System.Text;

using DirectUI.Mobile.UI.Controls;
namespace DirectUI.Mobile.UI
{
    public class DataBinding
    {
        public string DataSourceName
        {
            get;
            set;
        }
        private object _dataSource;
        public object DataSource
        {
            get
            {
                if (_dataSource == null)
                {
                    if(!string.IsNullOrEmpty(DataSourceName)){
                        if (GlobeDataSourcePool.Instance.DataSourceCollection.ContainsKey(DataSourceName))
                        {
                            _dataSource = ((DataSourceProvider)GlobeDataSourcePool.Instance.DataSourceCollection[DataSourceName]);
                        }
                    }
                }
                return _dataSource;
            }
            set
            {
                _dataSource = value;
            }
        }
        public PropertyPath Path
        {
            get;
            set;
        }
        public string XPath { get; set; }
        public string PropertyName
        {
            get;
            set;
        }
        public BindingMode Mode { get; set; }
      
    }
}
